package ru.ifmo.filemanager.local;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import ru.ifmo.filemanager.filesystem.abstractplugin.AbstractFile;

class LocalFile extends AbstractFile {

	private final File file;

	LocalFile(File file) {
		this.file = file;
	}

	public InputStream openForReading() throws IOException {
		return new FileInputStream(file);
	}

	public OutputStream openForWriting() throws IOException {
		return new FileOutputStream(file);
	}

	@Override
	public String getName() {
		return file.getName();
	}
}